<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>优惠券</title>

    <link rel="stylesheet" href="http://at.alicdn.com/t/font_608853_ykjxktkf2agojemi.css">

    <meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="stylesheet" href="https://cdn.bootcss.com/weui/1.1.2/style/weui.min.css">
    <script type="text/javascript" src="http://libs.baidu.com/jquery/1.9.1/jquery.js"></script>
    <script src="/static/js/jquery.qrcode.min.js"></script>
    <style>
        .headTitle {
            position: fixed;
            border: 1px solid #f4f4f4;
            border-top: none;
            border-left: none;
            border-right: none;
            background: #fff;
            width: 100%;
            height: 44px;
            line-height: 44px;
        }
        .head {
            position: absolute;
            width: 100%;
            max-width: 640px;
            right: 0;
            margin: 0 auto;
            height:44px;
            background: rgb(255, 255, 255);
            top: 0;
            left: 0;
            z-index: 3;
        }
        .head .title1 {
            text-align: center;
            font-size: 17px;
            margin: 0 8%;
            font-style: normal;
            font-weight: normal;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            height: 100%;


        }
        .head a img {
            float: left;
            display: block;
            width: 100%;
            width: 10px;
            height: 16px;
            margin-left: 5%;
            margin-top: 14px;
        }
    </style>
</head>
<body>
<header class="head headTitle" style="text-align: center">
    <a class="back" href="{:url('/home/Goods/goods')}"><img src="/static/images/back_gray.png" alt="返回"></a>
    <span style="margin-right: 8%">优惠券</span>
</header>

<div class="page__bd" style="margin-top: 50px;border-top: 0px solid #e5e5e5">

    <div class="weui-panel card_div" style="padding-top: 20px;padding-bottom: 20px;text-align: center;border-top: 0px solid #e5e5e5">

        <div id="output"></div>
        <div style="text-align: center;color: grey">
            请使用微信或爱屋家装小程序扫一扫
        </div>
        <img id="qrcodeimg"  src="/res/img/ewm.png" style="margin-top: 5px">

    </div>

</div>
<div style="width: 70%;margin: 0 auto;margin-top: 15px;color: grey;font-size: 15px">
    <div style="width: 100%;">
        <div style="float: left">
            <span>吐槽型开关</span>&nbsp<span style="color: rgb(237,108,0) ">￥</span>
            <span style="color: rgb(237,108,0) ">11</span>
        </div>
        <div style="float: right">
            <span>数量：</span>&nbsp<span style="color: rgb(237,108,0) ">{$cc}</span>
        </div>
    </div>
    <!--<div style="width: 100%;clear: both;padding-top: 10px">-->
        <!--<div style="float: left">-->
            <!--<span>合计：</span>&nbsp<span style="color: rgb(237,108,0) ">￥</span>-->
            <!--<span style="color: rgb(237,108,0) ">11</span>-->
        <!--</div>-->
        <!--<div style="float: right">-->
            <!--<span>优惠：</span>&nbsp<span style="color: rgb(237,108,0) ">￥</span>-->
            <!--<span style="color: rgb(237,108,0) ">11</span>-->
        <!--</div>-->
    <!--</div>-->
    <!--<div style="width: 100%;clear: both;padding-top: 10px">-->
        <!--<span>合计：</span>&nbsp<span style="color: rgb(237,108,0) ">￥</span>-->
        <!--<span style="color: rgb(237,108,0) ">11</span>-->
    <!--</div>-->
    <div style="width: 100%;clear: both;padding-top: 10px">
        <span>共优惠：</span>&nbsp<span style="color: rgb(237,108,0) ">￥</span>
        <span style="color: rgb(237,108,0) ">{$pp}</span>
    </div>

</div>
<div style="bottom: 100px;color: grey;text-align: center;position: fixed;width: 100%;color: orange">
<div style="width: 100%;clear: both;">
    <span class="sp sp-shop"  ></span>&nbsp{$item.shop_name}
</div>
<div style="width: 100%;clear: both;margin-top: 10px ">
    <span class="sp sp-location" ></span>&nbsp{$item.address}
</div>
</div>
</body>

<script>

    $('#output').html('');
    var qrcode = $('#output').qrcode(
        {width: 200, height: 200, correctLevel: 0, text: "{$url}"}
    ).hide();
    //生成图片
    var canvas = qrcode.find('canvas').get(0);
    $('#qrcodeimg').attr('src', canvas.toDataURL('image/jpg'))

</script>
</html>